package cu.ds.logicalsync.fytasrealm.communication;

import java.util.Set;

import cu.ds.logicalsync.fytasrealm.communication.event.MapStatusListener;
import cu.ds.logicalsync.fytasrealm.communication.model.PeerInfo;
import cu.ds.logicalsync.fytasrealm.model.World;

/**
 * MapStatusServiceProvider handle the following operations
 * 
 * @author r.vashira
 */
public interface MapStatusServiceProvider extends ServiceProvider {
	
	/**
	 * Create new World and register with Map then notify other clients
	 * @param allPeersThatWeKnow
	 * @return World with position associate with Map
	 * @throws CommunicationException 
	 */
	public World createNewWorld() throws CommunicationException;
	
	
	/**
     * Register a MapStatus listener. The MapStatus listener will be called 
     * whenever there is a event occur by the PeerStatus Service.
     *
     *  @param listener the MapStatusListener
     */
	public void addListener(MapStatusListener listener);
	
	/**
	 * Remove a MapStatus listener which was previously registered with
 	 * {@link #addListener(MapStatusListener) addListener()}.
	 * 
	 * @param listener The listener to be removed.
     *  @return true if the listener was successfully removed, false otherwise
	 */
	public boolean removeListener(MapStatusListener listener);
}
